#ifndef __OPERATORNODE__

#define __OPERATORNODE__

#include"integernode.h"
#include"variablenode.h"
#include"programnode.h"

enum _OPERATOR { _PLUS, _MINUS, _MULT, _DIV, _MOD, _EQUAL, _LT, _GT, _LE, _GE };

class OperatorNode : public ExpressionNode {
	public:
		
	_OPERATOR op;
	
	ExpressionNode * left;
	ExpressionNode * right;
		
	OperatorNode(_OPERATOR, ExpressionNode *, ExpressionNode *);
	OperatorNode(OperatorNode const &);
	~OperatorNode();
	
	ExpressionNode * eval(ProgramNode const &) const;
	bool isFreeVar(VariableNode const &) const;
	bool isBoundVar(VariableNode const &) const;
	ExpressionNode * subst(VariableNode const &, ExpressionNode const *);
	ProgramNode * defun() const;
	IntegerNode deint() const;
	
	ExpressionNode * copy() const;
	
	string toString() const;
};

#endif
